-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(script-tag): Include React and ReactDOM as dependencies, add installViewer export #721
Conversation
…nstallViewer function to simplify script tag usage.
Codecov Report
@@ Coverage Diff @@
## master #721 +/- ##
=========================================
- Coverage 0.68% 0.68% -0.01%
=========================================
Files 84 85 +1
Lines 1595 1602 +7
Branches 224 226 +2
=========================================
Hits 11 11
- Misses 1362 1367 +5
- Partials 222 224 +2
Continue to review full report at Codecov.
|
'PureComponent', | ||
'useRef', | ||
'useReducer', | ||
'useMemo', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's weird that this is a thing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah it's a pain, I don't know why this is necessary.
if (process && process.env && process.env.PUBLIC_URL) { | ||
homepage = process.env.PUBLIC_URL; | ||
} | ||
|
||
window.info = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we're attaching anything to the window with script-tag, you may want to vendor prefix:
$ohif.info
If only to reduce chances of conflict
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't change anything we are attaching, it just changes how process
is checked, since it is undefined sometimes.
We need to get away from using window.config
entirely and use Context or Redux to pass that data around. This can be another PR though.
} | ||
|
||
return ReactDOM.render(<App {...props}/>, container, callback); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think users will appreciate this. Thank you 🙌
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nothing jumped out at me. These seem like solid value adds.
Great work, Erik! ^_^
🎉 This PR is included in version 0.18.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Addresses #2 and #3 from this Issue: #521
Open to changing the name, not sure if
installViewer
is what users would expect.Script tag usage is a bit simpler now: